// -*-C++-*-

#pragma once
#ifndef API_DEBUG_HEADER
#define API_DEBUG_HEADER

#if defined(DEBUG) && ! defined(NO_DEBUG)
#define debug(X,...)  printf(X,##__VA_ARGS__);
#else
#define debug(X,...)
#endif

#if defined(__x86_64__) || defined(__i386__)
#define GDB_ENTRY { printf("Waiting for GDB to set %%eax to 1..\n"); \
      asm("mov $0,%eax ; 0: ; test %eax,%eax ; jz 0b"); }
#else
#define GDB_ENTRY
#endif


#if defined(DEBUG2) && ! defined(NO_DEBUG)
#define debug2(X,...)  printf(X,##__VA_ARGS__);
#else
#define debug2(X,...)
#endif
#endif
